home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-09-26 | 3.5 KB | 146 lines | [TEXT/MPS ] |
- //==========================================================
- // File: BeeperPart.h
- // Copyright: © 1995 by Apple Computer, Inc.
- //==========================================================
-
- #ifndef BEEPERPART_H
- #define BEEPERPART_H
-
- // ----- Framework Layer -----
-
- #ifndef FWPART_H
- #include "FWPart.h"
- #endif
-
- #ifndef FWFRAME_H
- #include "FWFrame.h"
- #endif
-
- // ----- Foundation Layer -----
-
- #ifndef FWHFCONN_H
- #include "FWHFConn.h"
- #endif
-
- //==========================================================
- // Forward Declarations
- //==========================================================
-
- #if FW_LIB_EXPORT_PRAGMAS
- #pragma import on
- #endif
- class FW_CLASS_ATTR FW_CNotification;
- class FW_CLASS_ATTR FW_CHandleFunctionConnection;
- class FW_CLASS_ATTR FW_CPushButton;
- #if FW_LIB_EXPORT_PRAGMAS
- #pragma import off
- #endif
-
- //==========================================================
- // Forward declarations
- //==========================================================
-
- class CAction;
-
- //==========================================================
- // class CBeeperPart
- //==========================================================
-
- class FW_CLASS_ATTR CBeeperPart : public FW_CPart
- {
- public:
- static const ODValueType kPartKind;
-
- //----------------------------------------------------------
- // Initialization/Destruction
- //
- public:
- CBeeperPart(ODPart* odPart);
- virtual ~CBeeperPart();
-
- virtual void Initialize(Environment* ev);
-
- //----------------------------------------------------------
- // Inherited API
- //
- public:
- virtual FW_CFrame* NewFrame(Environment* ev,
- ODFrame* odFrame,
- FW_CPresentation* presentation,
- FW_Boolean fromStorage);
-
- virtual void InternalizeContent(Environment* ev,
- ODStorageUnit* storage,
- FW_CCloneInfo* cloneInfo);
-
- virtual void ExternalizeContent(Environment* ev,
- ODStorageUnit* storage,
- FW_CCloneInfo* cloneInfo);
-
- //----------------------------------------------------------
- // New API
- //
- public:
- CAction* GetAction() { return fAction; }
- void SetAction(CAction* action);
-
- public:
- void DoAction();
-
- //----------------------------------------------------------
- // Data Members
- //
- private:
- CAction* fAction;
- };
-
- //==========================================================
- // class CBeeperFrame
- //==========================================================
-
- class FW_CLASS_ATTR CBeeperFrame : public FW_CFrame,
- public FW_MReceiver
- {
- //----------------------------------------------------------
- // Initialization/Destruction
- //
- public:
- CBeeperFrame(Environment* ev, ODFrame* frame,
- FW_CPresentation* presentation, CBeeperPart* part);
- virtual ~CBeeperFrame();
-
- //----------------------------------------------------------
- // FW_CFrame overrides
- //
- public:
- virtual void CreateGadgetLayout(Environment* ev,
- FW_CGadgetInitializer& initializer);
-
- virtual ODDragResult CanAcceptDrop(Environment* ev,
- ODDragItemIterator* dragInfo);
-
- virtual void Draw(Environment* ev,
- ODFacet* facet, ODShape* invalidShape);
-
- virtual void FrameShapeChanged(Environment* ev);
-
- //----------------------------------------------------------
- // FW_MReceiver overrides
- //
- public:
- virtual void HandleNotification(
- const FW_CNotification& notification);
-
- //----------------------------------------------------------
- // Data Members
- //
- private:
- CBeeperPart* fBeeperPart;
- FW_CPushButton* fBeeper;
- ODID fButtonId;
- FW_CHandleFunctionConnection fConnection;
- ODTypeToken fButtonNotificationToken;
- };
-
- #endif
-